#ifndef PLATFORM_H_
#define PLATFORM_H_

#include "common.h"

// Initialize platform (load files). Returns 0 on success.
int platform_init(void);

// Cleanup platform
void platform_close(void);

// Lock/unlock platform for external synchronization (threadsafety helpers)
// These are optional helpers; the platform functions themselves are made
// thread-safe where necessary.
void platform_lock(void);
void platform_unlock(void);

// Execute a command and fill reply
Reply execute_cmd(const Command *cmd);

// helper for tests: add a user and return id
int platform_add_user(const char *name);

// helper: persist goods
int platform_add_goods(const Goods *g);

#endif
